package com.pospi.pospihold.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.pospi.pospihold.dto.OrderBeen;
import com.pospi.pospihold.dto.PayBeen;
import com.pospi.pospihold.dto.PrintBeen;

import com.pospi.pospihold.greendao.OrderBeenDao;
import com.pospi.pospihold.greendao.PayBeenDao;
import com.pospi.pospihold.greendao.PrintBeenDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig orderBeenDaoConfig;
    private final DaoConfig payBeenDaoConfig;
    private final DaoConfig printBeenDaoConfig;

    private final OrderBeenDao orderBeenDao;
    private final PayBeenDao payBeenDao;
    private final PrintBeenDao printBeenDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        orderBeenDaoConfig = daoConfigMap.get(OrderBeenDao.class).clone();
        orderBeenDaoConfig.initIdentityScope(type);

        payBeenDaoConfig = daoConfigMap.get(PayBeenDao.class).clone();
        payBeenDaoConfig.initIdentityScope(type);

        printBeenDaoConfig = daoConfigMap.get(PrintBeenDao.class).clone();
        printBeenDaoConfig.initIdentityScope(type);

        orderBeenDao = new OrderBeenDao(orderBeenDaoConfig, this);
        payBeenDao = new PayBeenDao(payBeenDaoConfig, this);
        printBeenDao = new PrintBeenDao(printBeenDaoConfig, this);

        registerDao(OrderBeen.class, orderBeenDao);
        registerDao(PayBeen.class, payBeenDao);
        registerDao(PrintBeen.class, printBeenDao);
    }
    
    public void clear() {
        orderBeenDaoConfig.clearIdentityScope();
        payBeenDaoConfig.clearIdentityScope();
        printBeenDaoConfig.clearIdentityScope();
    }

    public OrderBeenDao getOrderBeenDao() {
        return orderBeenDao;
    }

    public PayBeenDao getPayBeenDao() {
        return payBeenDao;
    }

    public PrintBeenDao getPrintBeenDao() {
        return printBeenDao;
    }

}
